﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BasicCMS.Data
{
    /// <summary>
    /// 工作单元接口
    /// </summary>
    public interface IUnitOfWork:IDisposable
    {
        /// <summary>
        /// 开始插入功能
        /// </summary>
        /// <param name="tableName"></param>
        InsertBuilder Insert(string tableName);

        /// <summary>
        /// 开始更新功能
        /// </summary>
        /// <param name="tableName"></param>
        UpdateBuilder Update(string tableName);

        /// <summary>
        /// 开始删除功能
        /// </summary>
        /// <param name="tableName"></param>
        DeleteBuilder Delete(string tableName);

        /// <summary>
        /// 开始执行SQL
        /// </summary>
        /// <param name="sql"></param>
        ExecuteBuilder Execute(string sql);

        /// <summary>
        /// 开始查询功能
        /// </summary>
        /// <param name="sql"></param>
       QueryBuilder Query(string sql);

       QueryTableBuilder Table(string tableName);

        void Commit();
    }
}
